﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld" %>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default x-panel x-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/content">内容管理</a></li>
          <li class="active">文章管理</li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 x-panel-layout-right">

          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire"></i>&nbsp;&nbsp;<span>文章管理&nbsp;-&nbsp;文章列表</span></h2>
            </div>
          </div>
          
         <div class="x-toolbar-wrapper x-breadcrumb clearfix" style="margin: 10px 0; padding: 0 0 10px 0;">
            <div class="btn-group pull-left">
              <select name="module" class="select2">
                <option value="">全部</option>
                <c:forEach var="module" items="${persist.modules}">
                  <c:if test="${not module.value.disabled}">
                  	<option value="${module.key}" ${(module.key == param.module) or (module.key == param.moduleId) ? 'selected' : ''}>${module.value.name}</option>
                  </c:if>
                </c:forEach>
              </select>
            </div>
            <div class="btn-group pull-right">
               <a href="${ctx.host}/articles/create${not empty queryString ? '?'.concat(queryString) : ''}" class="btn btn-default x-btn btn-shadow btn-shadow-default">
                 <i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加文章
               </a>
               <a href="${ctx.host}/articles/search${not empty queryString ? '?'.concat(queryString) : ''}" data-target="#" data-target="#"  data-toggle="modal" title="过滤查询" class="btn btn-default x-btn btn-shadow btn-shadow-default">
                 <i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;过滤查询
               </a>
            </div>
          </div>
          
          
          <div class="x-cards row" style="margin-top: 20px;">
            
            <div class="col-xs-4" style="padding: 0px;">
              <c:forEach items="${articles}" var="articleModule" begin="0" step="3">
                <div class="col-xs-12 card">
                  <div class="panel panel-default denver-panel denver-panel-layout">
                    <div class="panel-heading clearfix">
                      <span class="ellipsis" style="display:block; width: 220px; float: left;">${articleModule.article.name}</span>
                      <a class="pull-right" href="${ctx.host}/articles/${articleModule.article.id}"><i class="glyphicon glyphicon-menu-right"></i></a>
                    </div>
                    <div class="panel-body" style="padding: 0px;">
                      <div class="panel-img-wrapper">
                        <img alt="" src="${cloud.prod}/${articleModule.article.cover}-150">
                      </div>
                      <p style="padding: 10px; margin: 0px; border-bottom: 1px solid #ccc">
                        <c:if test="${articleModule.serial > 100}">
                          <label class="label label-success">已置顶</label>
                        </c:if>
                      </p>
                      <p style="padding: 0px; margin: 10px; height: 70px; overflow: hidden; line-height: 22px;">
                        ${articleModule.article.summary}
                      </p>
                      <p style="padding: 0 10px; color: #777;"><small>上传时间：<fmt:formatDate value = "${articleModule.article.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></small></p>
                    </div>
                    <div class="panel-footer clearfix">
                      <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}" data-toggle="tooltip" data-placement="left" title="详情"><i class="glyphicon glyphicon-file"></i></a>
                      <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}/delete" data-target="#article-module-delete"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="删除"><i class="glyphicon glyphicon-remove"></i></a>
                      <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}/stick?moduleId=${param.moduleId}" data-target="#article-module.stick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="置顶"><i class="glyphicon glyphicon-arrow-up"></i></a>
                      <c:if test="${articleModule.serial > 100 }">
                        <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}/unstick?moduleId=${param.moduleId}" data-target="#article-module-unstick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="取消置顶"><i class="glyphicon glyphicon-arrow-down"></i></a>
                      </c:if>
                    </div>
                  </div>
                </div>
              </c:forEach>
            </div>
            <div class="col-xs-4" style="padding: 0px;">
              <c:forEach items="${articles}" var="articleModule" begin="1" step="3">
                <div class="col-xs-12 card">
                  <div class="panel panel-default denver-panel denver-panel-layout">
                    <div class="panel-heading clearfix">
                      <span class="ellipsis" style="display:block; width: 220px; float: left;">${articleModule.article.name}</span>
                      <a class="pull-right" href="${ctx.host}/articles/${articleModule.article.id}"><i class="glyphicon glyphicon-menu-right"></i></a>
                    </div>
                    <div class="panel-body" style="padding: 0px;">
                      <div class="panel-img-wrapper">
                        <img alt="" src="${cloud.prod}/${articleModule.article.cover}-150">
                      </div>
                      <p style="padding: 10px; margin: 0px; border-bottom: 1px solid #ccc">
                        <c:if test="${articleModule.serial > 100}">
                          <label class="label label-success">已置顶</label>
                        </c:if>
                      </p>
                      <p style="padding: 0px; margin: 10px; height: 70px; overflow: hidden; line-height: 22px;">
                        ${articleModule.article.summary}
                      </p>
                      <p style="padding: 0 10px; color: #777;"><small>上传时间：<fmt:formatDate value = "${articleModule.article.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></small></p>
                    </div>
                    <div class="panel-footer clearfix">
                      <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}" data-toggle="tooltip" data-placement="left" title="详情"><i class="glyphicon glyphicon-file"></i></a>
                      <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}/delete" data-target="#article-module-delete"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="删除"><i class="glyphicon glyphicon-remove"></i></a>
                      <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}/stick?moduleId=${param.moduleId}" data-target="#article-module-stick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="置顶"><i class="glyphicon glyphicon-arrow-up"></i></a>
                      <c:if test="${articleModule.serial > 100 }">
                        <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}/unstick?moduleId=${param.moduleId}" data-target="#article-module-unstick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="取消置顶"><i class="glyphicon glyphicon-arrow-down"></i></a>
                      </c:if>
                    </div>
                  </div>
                </div>
              </c:forEach>
            </div>
            <div class="col-xs-4" style="padding: 0px;">
              <c:forEach items="${articles}" var="articleModule" begin="2" step="3">
                <div class="col-xs-12 card">
                  <div class="panel panel-default denver-panel denver-panel-layout">
                    <div class="panel-heading clearfix">
                      <span class="ellipsis" style="display:block; width: 220px; float: left;">${articleModule.article.name}</span>
                      <a class="pull-right" href="${ctx.host}/articles/${articleModule.article.id}"><i class="glyphicon glyphicon-menu-right"></i></a>
                    </div>
                    <div class="panel-body" style="padding: 0px;">
                      <div class="panel-img-wrapper">
                        <img alt="" src="${cloud.prod}/${articleModule.article.cover}-150">
                      </div>
                      <p style="padding: 10px; margin: 0px; border-bottom: 1px solid #ccc">
                        <c:if test="${articleModule.serial > 100}">
                          <label class="label label-success">已置顶</label>
                        </c:if>
                      </p>
                      <p style="padding: 0px; margin: 10px; height: 70px; overflow: hidden; line-height: 22px;">
                        ${articleModule.article.summary}
                      </p>
                      <p style="padding: 0 10px; color: #777;"><small>上传时间：${articleModule.article.createTime}</small></p>
                    </div>
                    <div class="panel-footer clearfix">
                      <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}" data-toggle="tooltip" data-placement="left" title="详情"><i class="glyphicon glyphicon-file"></i></a>
                      <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}/delete" data-target="#article-module-delete"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="删除"><i class="glyphicon glyphicon-remove"></i></a>
                      <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}/stick?moduleId=${param.moduleId}" data-target="#article-module-stick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="置顶"><i class="glyphicon glyphicon-arrow-up"></i></a>
                      <c:if test="${articleModule.serial > 100 }">
                        <a class="btn btn-default" href="${ctx.host}/articles/${articleModule.article.id}/unstick?moduleId=${param.moduleId}" data-target="#article-moduel-unstick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="取消置顶"><i class="glyphicon glyphicon-arrow-down"></i></a>
                      </c:if>
                    </div>
                  </div>
                </div>
              </c:forEach>
            </div>
            
          </div>
          
          <jsp:include page="/WEB-INF/include/page.jsp">
            <jsp:param name="url" value="articles" />
            <jsp:param name="queryString" value="${queryString}" />
          </jsp:include>

        </div>

      </div>
    </div>
  </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/content/article/article-module-list.js">
    <script type="text/javascript">
      require(['page/content/article/article-module-list'], function(page) {
        page.init()
      })
    </script>
  </d:resource>
</body>

</html>